home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-05-07 | 6.2 KB | 391 lines | [TEXT/DWat] |
- % Demo some of the various graphics features of Asymptote
-
- npts 0 % To clear out the labels
- graphframe 0.5 8 1.25 10
- scale 2
- drawtitle Examples of Asymptote Graphics
- scale 1
-
- graphframe 0.5 8 1 9
- graphpane_setup 3 3 0.25 0.5
- graphlimits 0 11 0 11
-
- % Point symbols
- graphpane 1 3
- fullscreen yes
- drawframe inside outside noticks nolabels nolabels nolabels nolabels
- drawtitle POINT SYMBOLS
- npts 10
- xrange 1 10
- rpn <y 1 >y
- rpn <x 10 * open + >p
- rpn <y 1 + >y
- plotpoints
- rpn <x 10 * cross + >p
- rpn <y 1 + >y
- pencolor blue
- plotpoints
- rpn <x 10 * star + >p
- rpn <y 1 + >y
- pencolor red
- plotpoints
- rpn <x 10 * filled + >p
- rpn <y 1 + >y
- pencolor green
- plotpoints
- rpn <x 10 * open + chs >p
- rpn <y 1 + >y
- penpattern gray
- pensize 1
- pencolor magenta
- plotpoints
- rpn <x 10 * cross + chs >p
- rpn <y 1 + >y
- pencolor blue
- penpattern black
- pensize 0.5
- plotpoints
- rpn <x 10 * star + chs >p
- rpn <y 1 + >y
- pensize 0.25
- pencolor yellow
- plotpoints
- fillpattern none
- pencolor green
- plotpoints
- rpn <x 10 * filled + chs >p
- rpn <y 1 + >y
- fillpattern gray
- pensize 0.5
- plotpoints
- fillpattern none
- pencolor red
- plotpoints
-
- pensize 0.25
- penpattern black
- fillpattern black
- pencolor black
-
- % Error bars
- graphpane 1 2
- showgraph
- drawframe inside outside noticks nolabels nolabels nolabels nolabels
- drawtitle ERROR BARS && LIMITS
- xrange 1 10
- rpn ran 1 + 4 * 2 + >y
- rpn ran 2 + 1.5 / ran 0 < -1 * dup 0 = + * >e
- ploterrors left
- rpn ran 2 + 1.5 / ran 0 < -1 * dup 0 = + * >e
- ploterrors right
- rpn ran 2 + 1.5 / ran 0 < -1 * dup 0 = + * >e
- ploterrors top
- rpn ran 2 + 1.5 / ran 0 < -1 * dup 0 = + * >e
- ploterrors bottom
- pointsymbol 4 filled
- pointsize 4
- pencolor red
- plotpoints
-
- % Set up to errors with no cross bars or arrows, just lines
- pencolor blue
- scale 0
- rpn ran 1 + 4 * 2 + >y
- rpn ran 2 + 1.5 / ran 0 < -1 * dup 0 = + * >e
- ploterrors left
- rpn ran 2 + 1.5 / ran 0 < -1 * dup 0 = + * >e
- ploterrors right
- rpn ran 2 + 1.5 / ran 0 < -1 * dup 0 = + * >e
- ploterrors top
- rpn ran 2 + 1.5 / ran 0 < -1 * dup 0 = + * >e
- ploterrors bottom
- pointsymbol 4 filled
- pointsize 4
- pencolor red
- scale 1
- plotpoints
-
- pencolor black
- showgraph
-
- % Pen dashes & patterns
- graphpane 1 1
- showgraph
- drawtitle PEN DASHES && PATTERNS
- drawframe inside outside noticks nolabels nolabels nolabels nolabels
- moveto 1 1
- pensize 1
- penpattern black
- pendash long short
- pencolor y 10 * 0 100 y 10 * -
- drawto 10 y
-
- moveto 1 y 1 +
- pensize 1
- penpattern gray
- pendash long short short short
- pencolor y 10 * 0 100 y 10 * -
- drawto 10 y
-
- moveto 1 y 1 +
- pensize 0.25
- penpattern black
- pendash dot
- pencolor y 10 * 0 100 y 10 * -
- drawto 10 y
-
- moveto 1 y 1 +
- pensize 1
- penpattern lightgray
- pendash long short long short
- pencolor y 10 * 0 100 y 10 * -
- drawto 10 y
-
- moveto 1 y 1 +
- pensize 1
- penpattern black
- pendash dot dot long dot dot dot
- pencolor y 10 * 0 100 y 10 * -
- drawto 10 y
-
- moveto 1 y 1 +
- pensize 1
- penpattern darkgray
- pendash short dot dot dot
- pencolor y 10 * 0 100 y 10 * -
- drawto 10 y
-
- moveto 1 y 1 +
- pensize 0.5
- penpattern black
- pendash long dot dot dot dot dot
- pencolor y 10 * 0 100 y 10 * -
- drawto 10 y
-
- moveto 1 y 1 +
- pensize 1
- penpattern black
- pendash dot dot dot short short short
- pencolor y 10 * 0 100 y 10 * -
- drawto 10 y
-
- moveto 1 y 1 +
- pensize 3
- penpattern black
- pendash long short
- pencolor y 10 * 0 100 y 10 * -
- drawto 10 y
-
- moveto 1 y 1 +
- pensize 4
- penpattern diagonal
- pendash solid
- pencolor y 10 * 0 100 y 10 * -
- drawto 10 y
-
- pensize 0.25
- pendash solid
- penpattern black
- pencolor black
-
- % Fonts rotated text
- graphpane 2 3
- showgraph
- drawtitle LABELS && TEXT
- drawframe inside outside noticks nolabels nolabels nolabels nolabels
-
- moveto 2 2
- fontname times
- fontsize 24
- drawlabel center Label
-
- moveto 5 5
- fontname Times
- fontsize 12
- rotation 45
- pencolor 90 78 34
- drawlabel center y = 34 x\\u2 + 45.93
-
- moveto 7 2
- fontname Helvetica
- fontsize 24
- rotation 90
- pencolor red
- drawlabel center \st\\dH\d2O
-
- moveto 8 8
- fontname Palatino
- fontsize 24
- rotation 0
- pencolor blue
- drawlabel center y = e\\u-\ii\spx\sn
-
- moveto 1 10
- fontname Courier
- fontsize 8
- rotation 0
- pencolor 50 50 50
- drawlabel centerright Date:\# Time:\@
-
- moveto 1 5
- fontname Times
- fontsize 12
- rotation -45
- pencolor black
- drawlabel center \\iitalic
-
- moveto 10 3
- fontname Times
- fontsize 12
- rotation -45
- drawlabel centerleft \\sT/E - n/i
-
- moveto 3 7
- fontname Helvetica
- fontsize 12
- rotation 270
- drawlabel center TESTING
-
- rotation 0
- fontname Helvetica
- fontsize
-
-
- % Plot histogram
- graphpane 2 2
- showgraph
- drawtitle PLOT HISTOGRAMS
- drawframe inside outside noticks nolabels nolabels nolabels nolabels
-
- npts 36
- xrange -10 10
- rpn deg <x dup * -3 / e^x >y
- graphlimits
- fillpattern diagonal
- plothistogram 0
-
- % Plot polygon
- graphpane 2 1
- showgraph
- drawtitle PLOT POLYGONS
- drawframe inside outside noticks nolabels nolabels nolabels nolabels
- npts 7
-
- rpn ran >x ran >y
- sort
- graphlimits
- fillpattern darkgray
- penpattern gray
- pendash long
- pencolor blue
- plotpolygon closed
-
- pencolor black
- penpattern black
- fillpattern black
- pendash solid
-
- % Plot points & line
- graphpane 3 3
- showgraph
- drawtitle PLOT LINES && POINTS
- drawframe inside outside noticks nolabels nolabels nolabels nolabels
- pointsize 4
-
- npts 5
- rpn ran >x ran >y
- sort
- spline
- graphlimits
- pendash solid
- pensize 0.5
- pencolor 50 100 50
- plotline
- pensize 0.25
- pointsymbol 4 filled
- pencolor red
- plotpoints
-
- npts 5
- rpn ran >x ran >y
- sort
- spline
- graphlimits
- pendash short dot dot dot
- pensize 0.5
- pencolor 100 50 50
- plotline
- pensize 0.25
- pencolor cyan
- plotpoints
-
- npts 5
- rpn ran >x ran >y
- sort
- spline
- graphlimits
- pendash dot
- pensize 0.5
- pencolor 50 50 100
- plotline
- pensize 0.25
- pencolor magenta
- plotpoints
-
- pensize 0.15
- pendash solid
- pencolor black
-
- % Plot arrows
- graphpane 3 2
- showgraph
- drawtitle PLOT ARROWS
- drawframe inside outside noticks nolabels nolabels nolabels nolabels
- npts 30
-
- xrange 0 360
- rpn deg <x dup sin 2 * >x drop cos 2 * >y
-
- graphlimits -5 5 -5 5
- rpn <y 2 * <x 2 * <y <x roll+2
- pencolor blue
- plotarrows
- pointsymbol 20 filled
- pencolor 10 90 10
- plotpoints
-
- pencolor black
-
- % Plot labels
- graphpane 3 1
- showgraph
- drawtitle PLOT LABELS
- drawframe inside outside noticks nolabels nolabels nolabels nolabels
-
- npts 7
- rpn ran >x ran >y
- datafile Test Data
- datalines 2
- readcolumn l 1
- closewindow \f
- graphlimits -1.5 1.5 -1.5 1.5
- pointsymbol 4 filled
- pencolor 80 40 80
- plotpoints
- rpn <x 0.1 + >x
- pencolor red
- plotlabels centerright
- npts 0 % To clear out the labels
-
-
- closewindow xrange
- closewindow graphpane_setup
- closewindow graphpane
-
- showpage
-
-
-
-
-
-